1 //+-----------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // Defines the BindStatusCallback class of PresentationHost.
12 // Ported Windows->DevDiv. See SourcesHistory.txt.
14 //------------------------------------------------------------------------
18 #define IO_BUFFER_SIZE 4096
20 class CBindStatusCallback
: public IBindStatusCallback
24 CBindStatusCallback();
25 ~CBindStatusCallback();
27 LPCWSTR
GetCacheFilename() const
29 return m_cacheFilename
.Length() ? m_cacheFilename
.GetValue() : 0;
31 HRESULT
GetBindResult() const { return m_hrBindResult
; }
37 STDMETHODIMP
QueryInterface(REFIID riid
, __out LPVOID
* ppReturn
);
38 STDMETHODIMP_(ULONG
) AddRef();
39 STDMETHODIMP_(ULONG
) Release();
42 // IBindStatusCallback methods
45 STDMETHODIMP
OnStartBinding(DWORD dwReserved
, __in IBinding
*pib
);
46 STDMETHODIMP
GetPriority(__out_opt LONG
*pnPriority
);
47 STDMETHODIMP
OnLowResource(DWORD dwReserved
);
48 STDMETHODIMP
OnProgress(ULONG ulProgress
, ULONG ulProgressMax
, ULONG ulStatusCode
,
49 LPCWSTR szStatusText
);
50 STDMETHODIMP
OnStopBinding(HRESULT hresult
, LPCWSTR
/* szError */);
51 STDMETHODIMP
GetBindInfo(__out DWORD
*grfBINDF
,
52 __out BINDINFO
*pbindinfo
);
53 STDMETHODIMP
OnDataAvailable(DWORD grfBSCF
,
55 __in FORMATETC
*pformatetc
,
56 __in STGMEDIUM
*pstgmed
);
57 STDMETHODIMP
OnObjectAvailable(REFIID riid
, __in IUnknown
*punk
);
59 BOOL
IsXps() { return (m_Mime
== MimeType_Xps
); }
60 MimeType
GetMimeType() { return m_Mime
; }
61 STRING_PROP(MimeTypeString
);
68 IFillLockBytes
* m_pflb
;
69 HANDLE m_hMimeArrivedEvent
; // Event triggers when mime arrives
70 HANDLE m_hManifestAvailableEvent
; // Event triggers when the manifest is ready
71 class DownloadInfo
* m_pDownloadInfo
;
72 CString m_cacheFilename
;
78 CString m_strMimeTypeString
;
81 BOOL m_fTerminatedFLB
;
84 HRESULT m_hrBindResult
;
87 void BindTerminated();
88 void BindTerminated(HRESULT hr
);
89 void ResolveMimeTypeSecondChance(LPCWSTR pszLocalFile
);